<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
 <title>${name_china}管理-查看${name_china}</title>
 <%@include file="/common/head.jsp" %>
 <link href="<%=request.getContextPath()%>/static/plugin/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
 <script src="<%=request.getContextPath()%>/static/plugin/zTree/js/jquery.ztree.all-3.5.min.js"></script>
</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>${name_china}详情</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="form">
<div class="left-wrap">
    <input type="hidden" id="id" name="id"></input>
    <h3>商品信息</h3>
    <table id="product" class="table-view">
         <tr>
	       <td class="td-title">排序号</td>
	       <td><input type="text" id="orderBaokuan" name="orderBaokuan" class="summer-input summer-validatebox"  data-validatebox="validType:['noNegativeNumber']"></input></td>
        </tr>
        
          <tr>
	       <td class="td-title">商品类别</td>
	       <td><span name="categoryName"></span></td>
        </tr>
        
        <tr>
	       <td class="td-title">商品名称</td>
	       <td><span name="goodsName"></span></td>
        </tr>
        
         <tr>
	       <td class="td-title">商品原价</td>
	       <td><span name="oriPrice"></span></td>
        </tr>
        
         <tr>
	       <td class="td-title">商品卷后价</td>
	       <td><span name="conTicketPrice"></span></td>
        </tr>
        
         <tr>
	       <td class="td-title">商品库存</td>
	       <td><span name="goodsInventory"></span></td>
        </tr>
        
        <tr>
	       <td class="td-title">商品图片</td>
	       <td id="goodsUrl"></td>
        </tr>
        
        <tr>
	       <td class="td-title">备注</td>
	       <td><span name="note"></span></td>
        </tr>
        
    </table>
     <div class="form-btn-wrapper" id="funcbar">
        <a class="btn btn-normal" id="backBtn">关闭</a>
     </div>
</div>   
</form>
<script>

var  permission = CommonUtil.getPermission('${name_english}');
   $(function(){
	   var data = ${viewData};
	   $("#id").val(data.id);
	   $("#reorder").val(data.reorder);
	   $("#goodsUrl").append("<img src='"+data.goodsUrl+"' style='weight:100ps;height:100px;'></img>");
	   
	   $("#form").form().form("loadDataView",{
   		  data : data
   	   }); 
	   
	   $('#goBack,#backBtn').on('click', backHome);
	   
	   $('#funcbar').prepend($.funcbar({
           type: 'button',
           data: permission,
           permit: ['${name_english}:baokuan']
       }));
	   
	   //保存按钮
       $('#funcbar').on('click', 'a[data-permit="${name_english}:baokuan"]', {isContinue: false},  submit);
   	
   });
   
   //表单提交
   function submit() {
	   var id=$("#id").val();
	   var orderBaokuan=$("#orderBaokuan").val();
       $.ajax({
    	   url:basePath + "${common_url}baokuan",
    	   data:{"id":id,"orderBaokuan":orderBaokuan},
    	   success:function(data){
    		   $.stip({
 	                type:'ok',//显示类型 有info、 ok、 danger
 	                text: '保存成功！',
 	                onBeforeHide: function () {
 	                	backHome();
 	               }
             	});
    	   }
       });
   }
   
   function backHome() {
      window.location.href =  basePath + "${common_url}init";
   }
</script>
</body>
</html>